package com.spring.extjs.controller;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.spring.extjs.pageModel.AreaVO;
import com.spring.extjs.service.ISystemService;

@Controller
@RequestMapping("/system")
public class SystemController {

	Logger logger = LoggerFactory.getLogger(SystemController.class);
	
	@Autowired
	private ISystemService systemService;
	
	@RequestMapping("/province")
	public @ResponseBody List<AreaVO> provinceList() {
		
		return systemService.provinceList();
	}
	
	@RequestMapping("/city")
	public @ResponseBody List<AreaVO> cityList(int provinceId) {
		
		return systemService.cityList(provinceId);
	}
	
	@RequestMapping("/district")
	public @ResponseBody List<AreaVO> districtList(int cityId) {
		
		return systemService.districtList(cityId);
	}
}
